from typing import Union,Optional

from fastapi import APIRouter

app4 = APIRouter()

@app4.get('/jobs/{dz}')
# async def searchJobs(dz,xl = None ,xz=None):
# async def searchJobs(dz:str,xl:str =None ,xz:str=None):
# Union[str,None] =None 意思是xl可以是str类型也可以是None类型，默认值是None
# xz:Optional[str] = None 这个写法是 Union[str,None] 的简写形式
async def searchJobs(dz:str,xl:Union[str,None] =None ,xz:Optional[str] = None):
    """

    :param xl: 学历
    :param dz: 地址
    :param xz: 薪资
    :return:
    """
    return {
        'xl':xl,
        'dz':dz,
        'xz':xz
    }




